/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
import {
  ChangeDetectionStrategy,
  ChangeDetectorRef,
  Component,
  ContentChild,
  Host,
  Input,
  Optional, TemplateRef,
  ViewEncapsulation
} from '@angular/core';
import {
  ApesNoAnimationDirective, ApesTSType,
  zoomBigMotion,
} from '@shared/apes/core';
import { ApesToolTipBaseComponentLegacy } from "@shared/apes/tooltip/base";


@Component({
  selector: 'apes-tooltip',
  exportAs: 'apesTooltipComponent',
  changeDetection: ChangeDetectionStrategy.OnPush,
  encapsulation: ViewEncapsulation.None,
  animations: [zoomBigMotion],
  templateUrl: './apes-tooltip.component.html',
  preserveWhitespaces: false,
  providers: [
    {
      provide: ApesToolTipBaseComponentLegacy,
      useExisting: ApesToolTipComponent
    }
  ],
  styles: [
      `
      .apes-tooltip {
        position: relative;
      }
    `
  ]
})
export class ApesToolTipComponent extends ApesToolTipBaseComponentLegacy {
  @Input() apesTitle: ApesTSType | null;
  @ContentChild('apesTemplate', { static: true }) apesTitleTemplate: TemplateRef<void>;

  constructor(cdr: ChangeDetectorRef, @Host() @Optional() public noAnimation?: ApesNoAnimationDirective) {
    super(cdr);
  }
}
